<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pour faire l'appel'</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
//merci à http://www.siteduzero.com/forum-83-727273-p1-json-picasa-et-javascript.html
$j = jQuery.noConflict();

//GLOBAL VARIABLES
var album_picasa_user = "thyp1213@gmail.com";	//User name to find the picasa's album
var thumb_size = "72c";	//Size of the thumbnail	
	
//ALBUM GLOBAL VARIABLES
var album_info = new Array();
var album_Title = "";
var album_thumb_URL = "";
var album_ID = "";
var album_Description = "";

//PHOTO GLOBAL VARIABLES
var photo_Title = "";
var photo_thumb_URL = "";
var photo_URL = "";
var photo_ID = "";
var photo_Description = "";


function get_album_info(){
     /*
	* Get the informations of albums by query
	* Picasa send a JSON answer
	*/
	var json_Album_URI = "https://picasaweb.google.com/data/feed/base/"
		+ "user/"       +""+album_picasa_user
		+ "?alt="       +   "json"
		+ "&access"		+	"public"
		+ "&kind="      +   "album"
		+ "&thumbsize=" +   thumb_size;
	
	var pimpim = $j.getJSON(json_Album_URI, function(data){
		$j.each(data.feed.entry, function(i,data){
			//Get the title of the album
			album_Title = data.media$group.media$title.$t;
			//Get the URL of the album's thumbnail
			album_thumb_URL = data.media$group.media$thumbnail[0].url;
			//Get the ID of the album
			album_ID = data.id.$t;
				album_ID = album_ID.split('/')[9].split('?')[0];
			//Get the description of the album
			album_Description = data.media$group.media$description.$t;
			
			album_info[i]=new Array(album_Title, album_thumb_URL, album_ID, album_Description);
			});
		});	
	}

function get_photos(album_name, nbr){
	get_album_info();
	$j("<img/>")
				.attr("src", album_info[0][1])
				.attr("alt", pic.summary.$t);
	}

</script>
</head>
<body>


</body>
</html>